package schema

import (
	"time"
)

type Result struct {
	Msg string     `json:"msg" binding:"required"`
	Err string   	  `json:"err" binding:"required"`
	Data interface{}        `json:"data"`
	Code int	`json:"code" binding:"required"`
}



type SchemaJobStatusList []JobList

type JobList struct {
	Version    		string  		`json:"version" `
	ServerName		string	 		`json:"server_name"`
	User 			string 			`json:"user" `
	Description 	string 			`json:"description"`
	StartTime		time.Time		`json:"start_time"`
	EndTime			time.Time		`json:"end_time"`
	Instances 		[]string    	`json:"instances" `
	InstanceType 	string 			`json:"instance_type"`
	InstanceCount	int 			`json:"instance_count"`
	Status 			string			`json:"status"`
	Id 				uint 			`json:"id"`
}

type SchemaJobStatusDetail struct{
	JobId 			uint		`json:"job_id"`
	StartTime		time.Time	`json:"start_time"`
	EndTime			time.Time	`json:"end_time"`
	InstanceStatus 	[]SchemaJobInstances	`json:"instance_status"`
	InstanceCount	int			`json:"instance_count"`
	OkCount 		int			`json:"ok_count"`
	JobDefintion	string		`json:"job_model_context" `
	ServerName		string 		`json:"server_name" `
	Timeout			int			`json:"timeout" `
	Description 	string 		`json:"description" `
	Version    		string  	`json:"version" `
	RpmName			string 		`json:"rpm_name"`
	User 			string 		`json:"user" `
	JobPolicy		int 		`json:"job_policy"`
	Status 			string		`json:"status"`
}

type SchemaJobInstances struct {
	Instance 	string		`json:"instance"`
	StartTime		time.Time	`json:"start_time"`
	EndTime			time.Time	`json:"end_time"`
	Status 		string		`json:"status"`
}

type SchemaGroupEach struct {
	GroupName string `json:"group_name"`
	Id	uint	`json:"group_id"`
	Description string `json:"description"`
	ServerName string	`json:"server_name"`
	CreateAt 	time.Time	`json:"create_at"`
	UpdateAt  time.Time		`json:"update_at"`
	InstanceList []string	`json:"instance_list"`
	OfflineList []string 	`json:"offline_list"`
	User string	`json:"user"`
}

type SchemaCreateGroup struct {
	GroupName string `json:"group_name"`
	Description string `json:"description"`
	ServerName string	`json:"server_name"`
	InstanceList []string	`json:"instance_list"`
	User string	`json:"user"`
}

type SchemaCreateGroupResult struct {
	ErrInstance []string `json:"err_instance"`
}